package com.example.easyexcel.exports;

import com.example.easyexcel.converters.vo.HyperlinkVo;
import com.example.easyexcel.enums.BoolEnum;
import com.example.easyexcel.exports.dtos.ExportDataDTO;

import java.io.File;
import java.io.FileInputStream;
import java.util.*;

/**
 * 模拟数据
 * */
public class MockDatas {
    // 自定义的导出列及其顺序
    public static List<String> fieldsInSpecifiedOrder = Arrays.asList(
             "dropdownBox_enum"
            ,"file"
//            ,"inputStreamer"   // 流类型的，在自定义顺序中，需要指定转换，注解类型中不需要指定转换
            ,"link"
            ,"dropdownBox_db"
            ,"dropdownBox_fixed"
            ,"imagePath"
            ,"commentField"
            ,"字段_2"
            ,"字段_1"
            ,"enumer"
            ,"str_ignore"
            ,"boo"
            ,"int2str"
            ,"dateTime"
            ,"str"
            ,"num2"
            ,"unExistField"
            ,"num"
    );

    // 可用于导出模板
    public static List<ExportDataDTO> emptyList = Collections.emptyList();
    //
    public static List<ExportDataDTO> getDdataList(){
        return new ArrayList<ExportDataDTO>(){{

            String file = "C:\\Users\\Administrator\\Desktop\\"+"2023-11-01_012449.png";
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream(new File(file));
            } catch ( Exception e) {
                e.printStackTrace();
            }

            add(new ExportDataDTO()
                    .setNum(999999999999999L).setNum2(999999999999999L)
                    .setStr("str-1").setDateTime(new Date()).setStr_ignore("ignore12345")
                    .setInt2str(0).setBoo(true).setEnumer(BoolEnum.TURE)
                    .setCommentField("朱朱1")
                    .setDropdownBox_fixed("耗材").setDropdownBox_db("下拉数据_1aaaaaaaaaaaaaaaaaaaaaaaaaaaa").setDropdownBox_enum(BoolEnum.TURE)
                    .setImagePath("...1...")
            );
            add(new ExportDataDTO()
                    .setNum(222L)
                    .setStr("str-3").setDateTime(new Date()).setStr_ignore("ignore67890")
                    .setInt2str(1).setBoo(false).setEnumer(BoolEnum.FALSE)
                    .setCommentField("朱朱2")
                    .setDropdownBox_fixed("医疗设备").setDropdownBox_db("下拉数据_2").setDropdownBox_enum(BoolEnum.FALSE)
                    .setImagePath("...2...")
                    .setLink(new HyperlinkVo("这是个链接","https://www.hao123.com/?tn=49055317_1_hao_pg"))
                    .setFile( new File(file) )
                    .setInputStreamer( fileInputStream )
            );
        }};
    }

}







